#set(String masterMenu = "1")
#set(String sysActiveMenu = "4")
#tag layout_block("sidebar")
	#include("/fragment/menu.html")
#end
#tag layout_block("main")
	<div id="repast-list" v-cloak>
		<div class="col-xs-12">
			<table class="table table-hover custom-table">
				<thead>
					<tr>
						<th>序号</th>
						<th>就餐时间</th>
						<th>结账时间</th>
						<th>应收金额</th>
						<th>实收金额</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr v-for="item in content">
						<td>{{page*size+$index+1}}</td>
						<td>{{item.created | moment-ts}}</td>
						<td>{{item.end | moment-ts}}</td>
						<td>{{item.rece | fixed 2 }}</td>
						<td>{{item.actual | fixed 2 }}</td>
						<td>
							<button type="button" class="btn btn-xs btn-primary" @click="showMenu(item.id)">菜单</button>
							<button v-if="item.descr" type="button" class="btn btn-xs btn-info" @click="showDescr(item.descr)">备注</button>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="col-xs-12 archive-pages text-center" id="laypage-ctl"></div>
		<!-- 菜单 -->
		<div class="modal fade" id="repast-menu-modal" tabindex="-1" role="dialog"
			aria-labelledby="repastMenuLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">
							<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
						</button>
						<h4 class="modal-title" id="repastMenuLabel">菜单</h4>
					</div>
					<div class="modal-body">
						<div class="row">
							<div v-show="menu && menu.length>0" class="col-xs-12">
								<table class="table table-hover custom-table" style="margin-bottom: 0;">
									<thead>
										<tr>
											<th>名称</th>
											<th>单价</th>
											<th>数量</th>
											<th>合计(元)</th>
										</tr>
									</thead>
									<tbody>
										<tr v-for="item in menu">
											<td>{{item.name}}</td>
											<td>{{item.price | fixed 2 }}</td>
											<td>{{item.num}}</td>
											<td>{{(item.price*item.num) | fixed 2 }}</td>
										</tr>
										<tr>
											<td colspan="3"></td>
											<td colspan="1">{{calcTotal(menu,'price','num')}}元</td>
										</tr>
									</tbody>
								</table>
							</div>
							<div v-else class="col-xs-12 text-danger text-center">
								<span class="">该桌尚未点餐</span>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="assets/js/laypage.js"></script>
	<script type="text/javascript" src="assets/js/biz/repast/list.js"></script>
#end
#include ("/layout/default.html")